#include "StdAfx.h"
#include "TeamModel.h"


CTeamModel::CTeamModel(void)
{
	m_id = 0;
	m_companyID = 0;
	m_teamLeader = 0;
	m_teamName = _T("");

	m_htreeitem = nullptr;
}

CTeamModel::~CTeamModel(void)
{
}

void CTeamModel::parseFromJson(Json::Value& jsonData)
{
	if (!jsonData["id"].isNull())
	{
		this->m_id = jsonData["id"].asInt();
	}
	if (!jsonData["companyID"].isNull())
	{
		this->m_companyID = jsonData["companyID"].asInt();
	}
	CUtils::getJsonStringField(jsonData, "teamName", m_teamName);
	if (!jsonData["teamLeader"].isNull())
	{
		this->m_teamLeader = jsonData["teamLeader"].asInt();
	}
	if (!jsonData["monthPlan"].isNull())
	{
		this->m_monthPlan = jsonData["monthPlan"].asInt();
	}
	if (!jsonData["weekPlan"].isNull())
	{
		this->m_weekPlan = jsonData["weekPlan"].asInt();
	}
}
